﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EntityModel
{
    public class HallDbContext:DbContext
    {
        public HallDbContext(DbContextOptions<HallDbContext> opst) : base(opst)
        {
        }
        public DbSet<EM_User> EM_User { get; set; }

        public DbSet<BillFare> eM_BillFare { get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<EM_User>().HasData([
                new EM_User(){

                     FristName="张",
                     LastName="三",
                     Type=1,
                     Pay=10000,
                     Gender=true,
                     Age=20,
                     AddTime=DateTime.Now
                },
                new EM_User(){
                     FristName="李",
                     LastName="四",
                     Type=3,
                     Pay=8000,
                     Gender=false,
                     Age=24,
                     AddTime=DateTime.Now
                }
                ]);
            
        }
    }
}
